/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ContainedByRightSideComponent.java
 *
 * Created on 28.05.2009, 18:16:20
 */
package peripheral.designer.conditions;

/**
 *
 * @author Andi
 */
public class ContainedByRightSideComponent extends javax.swing.JPanel {

    /** Creates new form ContainedByRightSideComponent */
    public ContainedByRightSideComponent() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        textFieldLowerBound = new javax.swing.JFormattedTextField();
        jLabel1 = new javax.swing.JLabel();
        textFieldUpperBound = new javax.swing.JFormattedTextField();

        setMinimumSize(new java.awt.Dimension(50, 10));
        setPreferredSize(new java.awt.Dimension(80, 10));

        textFieldLowerBound.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        textFieldLowerBound.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        textFieldLowerBound.setText("0.00");
        textFieldLowerBound.setPreferredSize(new java.awt.Dimension(50, 20));
        add(textFieldLowerBound);

        jLabel1.setText("und");
        add(jLabel1);

        textFieldUpperBound.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0.00"))));
        textFieldUpperBound.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        textFieldUpperBound.setText("100.00");
        textFieldUpperBound.setPreferredSize(new java.awt.Dimension(50, 20));
        add(textFieldUpperBound);
    }// </editor-fold>//GEN-END:initComponents

    public double getLowerBound() {
        return Double.parseDouble(this.textFieldLowerBound.getText().replace(',', '.'));
    }

    public double getUpperBound() {
        return Double.parseDouble(this.textFieldUpperBound.getText().replace(',', '.'));
    }

    public void setLowerBound(double lower) {
        this.textFieldLowerBound.setText(String.valueOf(lower));
    }

    public void setUpperBound(double upper) {
        this.textFieldUpperBound.setText(String.valueOf(upper));
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JFormattedTextField textFieldLowerBound;
    private javax.swing.JFormattedTextField textFieldUpperBound;
    // End of variables declaration//GEN-END:variables
}
